/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PLJAVA_CONST_REF_INFO_H
#define PLJAVA_CONST_REF_INFO_H

#include <PLJavaFile.h>

namespace PLSDK {

/**
 * Information about a ref entry in the file const section.
 */
class PLJavaConstRefInfo : public PLJavaConst {
public:
    /**
     * Constrcutor.
     *
     * @param type The type of the ref.
     * @param newClassIndex The index of the class information from the ref.
     * @param newNameAndTypeIndex The index of the name and type information
     * from the ref.
     */
    PLJavaConstRefInfo(PLJavaConst::ConstTypes type, u2 newClassIndex, u2 newNameAndTypeIndex);
    /**
     * Get the index of the class information.
     *
     * @return The index.
     */
    inline u2 classIndex() const;
    /**
     * Get the index to the name and type information.
     *
     * @return The index.
     */
    inline u2 nameAndTypeIndex() const;
private:
    u2 m_classIndex;
    u2 m_nameAndTypeIndex;
};

u2 PLJavaConstRefInfo::classIndex() const {
    return m_classIndex;
}

u2 PLJavaConstRefInfo::nameAndTypeIndex() const {
    return m_nameAndTypeIndex;
}

}

#endif
